ClutterColor foreground_color;
ClutterColor border_color[4];
- double border_width[4];
- double border_radius[4];
+ int border_width[4];
+ int border_radius[4];
guint padding[4];
int width;
return VALUE_FOUND;
}
+static GetFromTermResult
+get_length_from_term_int (StThemeNode *node,
+ CRTerm *term,
+ gboolean use_parent_font,
+ gint *length)
+{
+ double value;
+ GetFromTermResult result;
+
+ result = get_length_from_term (node, term, use_parent_font, &value);
+ if (result != VALUE_NOT_FOUND)
+ *length = (int) (0.5 + value);
+ return result;
+}
+
static GetFromTermResult
get_length_internal (StThemeNode *node,
const char *property_name,
gboolean bottomright,
gboolean bottomleft)
{
- gdouble value;
+ int value;
- if (get_length_from_term (node, term, FALSE, &value) != VALUE_FOUND)
+ if (get_length_from_term_int (node, term, FALSE, &value) != VALUE_FOUND)
return;
if (topleft)
StSide side = (StSide)-1;
ClutterColor color;
gboolean color_set = FALSE;
- double width;
+ int width;
gboolean width_set = FALSE;
int j;
if (term->type == TERM_NUMBER)
{
- result = get_length_from_term (node, term, FALSE, &width);
+ result = get_length_from_term_int (node, term, FALSE, &width);
if (result != VALUE_NOT_FOUND)
{
width_set = result == VALUE_FOUND;
if (decl->value == NULL || decl->value->next != NULL)
return;
- if (get_length_from_term (node, decl->value, FALSE, &width) == VALUE_FOUND)
+ if (get_length_from_term_int (node, decl->value, FALSE, &width) == VALUE_FOUND)
/* Ignore inherit */
width_set = TRUE;
}
gboolean top,
gboolean bottom)
{
- gdouble value;
- int int_value;
+ int value;
- if (get_length_from_term (node, term, FALSE, &value) != VALUE_FOUND)
+ if (get_length_from_term_int (node, term, FALSE, &value) != VALUE_FOUND)
return;
- /* Round the value */
- int_value = (int) (0.5 + value);
-
if (left)
- node->padding[ST_SIDE_LEFT] = int_value;
+ node->padding[ST_SIDE_LEFT] = value;
if (right)
- node->padding[ST_SIDE_RIGHT] = int_value;
+ node->padding[ST_SIDE_RIGHT] = value;
if (top)
- node->padding[ST_SIDE_TOP] = int_value;
+ node->padding[ST_SIDE_TOP] = value;
if (bottom)
- node->padding[ST_SIDE_BOTTOM] = int_value;
+ node->padding[ST_SIDE_BOTTOM] = value;
}
static void
static void
do_size_property (StThemeNode *node,
CRDeclaration *decl,
- int *node_value)
+ int *node_value)
{
- gdouble value;
-
- if (get_length_from_term (node, decl->value, FALSE, &value) == VALUE_FOUND)
- *node_value = (int) (0.5 + value);
+ get_length_from_term_int (node, decl->value, FALSE, node_value);
}
static void
node->height = node->min_height;
}
-double
+int
st_theme_node_get_border_width (StThemeNode *node,
StSide side)
{
return node->border_width[side];
}
-double
+int
st_theme_node_get_border_radius (StThemeNode *node,
StCorner corner)
{